package com.firmiana.jt809.protocol.send;

import com.firmiana.jt809.entity.JT809Message;
import com.firmiana.jt809.protocol.ISendProtocol;
import com.firmiana.jt809.util.Tools;

/**
 * 主链路登录响应
 * @author hucl
 * @date 2020/8/26 9:02
 */
public class MainSendRespProtocol implements ISendProtocol {
    private int result;
    private int verifyCode;

    public MainSendRespProtocol(int result, int verifyCode) {
        this.result = result;
        this.verifyCode = verifyCode;
    }

    @Override
    public JT809Message wrap() {
        String body = Tools.toHexString(result, 1) + Tools.toHexString(verifyCode, 4);
        return new JT809Message(0x1002, body);
    }
}
